package com.acknight.service.impl;

import com.acknight.constant.RedisConstants;
import com.acknight.entity.VoucherOrder;
import com.acknight.utils.RedisIdWorker;
import com.acknight.utils.UserHolder;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.acknight.dto.Result;
import com.acknight.entity.Voucher;
import com.acknight.mapper.VoucherMapper;
import com.acknight.entity.SeckillVoucher;
import com.acknight.service.ISeckillVoucherService;
import com.acknight.service.IVoucherService;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;

import static com.acknight.constant.RedisConstants.SECKILL_STOCK_KEY;

@Service
public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, Voucher> implements IVoucherService {

    @Override
    public Result queryVoucherOfShop(Long shopId) {
        // 查询优惠券信息
        List<Voucher> vouchers = getBaseMapper().queryVoucherOfShop(shopId);
        // 返回结果
        return Result.ok(vouchers);
    }
}
